﻿<?php
require "../template/header.php";
require "../function/function_user.php";

if ($mysqlpass!=$cookiepass){
header("Location:../do.php?type=logints");
}
?>
	<body>
		<div id="warp">
			<div id="user-header">
				<div id="user-logo">
					<a href="./">
						<img border="0" src="../images/logo.png">
					</a>
				</div>
<?php
require_once "../template/user_info.php";
?>
			</div>
			<div id="user-content">
				<div id="user-content-left">
<?php
require_once "../template/user_menu.php";
?>
				</div>
				<div id="user-content-right">
					<div id="user-content-right-main">
						<div id="user-content-right-main-tou">
							<a href="./">首页</a> > <a href="./">推广中心</a>
						</div>
						<div id="user-content-right-main-spread">
							<div id="user-content-right-main-spread-a">
							<!-- 开始 -->
								<div id="user-content-right-main-spread-a-a">
									<div id="user-content-right-main-spread-a-a-a">
										推广人数:
									</div>
									<div id="user-content-right-main-spread-a-a-b">
										<span class="spread-ren">
										<?php
										if (isset($_GET['type'])){
											if ($_GET['type']=="quota"){
												if ($userinfo['spread']>=10){
													echo $userinfo['spread'] - 10;
												}else{
													echo $userinfo['spread'];
												}
											}elseif ($_GET['type']=="uptip"){
												if ($userinfo['spread']>=30){
													echo $userinfo['spread'] - 30;
												}else{
													echo $userinfo['spread'];
												}
											}else{
												echo $userinfo['spread'];
											}
										}else{
										echo $userinfo['spread'];
										}
										?></span>人
									</div>
								</div>
							<!-- 结束 -->
							<!-- 开始 -->
								<div id="user-content-right-main-spread-a-a">
									<div id="user-content-right-main-spread-a-a-a">
										推广连接:
									</div>
									<div id="user-content-right-main-spread-a-a-b">
										<span class="spread-link"><?php echo "http://".$_SERVER['HTTP_HOST']."/?xid=".$userinfo['id'];?></span>
										请复制后发给你的好友或QQ群、微博、论坛、博客
									</div>
								</div>
							<!-- 结束 -->
							<!-- 开始 -->
								<div id="user-content-right-main-spread-a-a">
									<div id="user-content-right-main-spread-a-a-a">
										宣传标语:
									</div>
									<div id="user-content-right-main-spread-a-a-b">
										<textarea readonly>
    【挂Q网之蓝色梦想】
梦幻般的蓝色带着无限神秘的土地，
在这里拥有着一群爱好QQ号的朋友。
他们自己把所有的QQ号码放在这里，
希望有一天能够变成太阳照耀世界。
但是恶魔麻花疼却阻止了太阳生长，
勇敢的挂Q义勇当前不断研发科技。
终于在2014年麻花疼被梦想打败了，
挂Q让所有的QQ用户梦想成真了。

最新最好玩的挂Q应用就在下面
<?php echo "http://".$_SERVER['HTTP_HOST']."/?xid=".$userinfo['id'];?>
										</textarea>
									</div>
								</div>
							<!-- 结束 -->
							</div>
							<div id="user-content-right-main-spread-b-cao">
								<table class="user-info-table">
									<thead>
										<tr>
											<th>扩充项目</th>
											<th>扩充条件</th>
											<th>扩充操作</th>
										</tr>
									</thead>
									<tbody>
										<tr>
											<td>挂Q配额</td>
											<td>扣去10个推广人数增加5个挂Q配额</td>
											<td>
											<?php
												if (isset($_GET['type'])){
													if ($_GET['type']=="quota"){
														if ($userinfo['spread']>=10){
															$spread=$userinfo['spread'] - 10;
															$quota=$userinfo['quota'] + 5 ;
															mysql_query("update xige_info set spread='$spread' where email='$cookieuser' ");
															mysql_query("update xige_info set quota='$quota' where email='$cookieuser' ");
															echo '<a href="?type=quota">增加成功</a>';
														}else{
															echo "推广不足";
														}
													}else{
														echo '<a href="?type=quota">增加配额</a>';
													}
												}else{
												echo '<a href="?type=quota">增加配额</a>';
												}
											?>
											</td>
										</tr>
										<tr>
											<td>会员级别</td>
											<td>扣去30个推广人数提升为“顶尖会员”永久</td>
											<td>
											<?php
												if ($userdata['tip']=="1"){
													echo "您已开通";
												}elseif (isset($_GET['type'])){
													if ($_GET['type']=="uptip"){
														if ($userinfo['spread']>=30){
															if ($userdata['tip']=="0"){
																$spread=$userinfo['spread'] - 30;
																$quota=$userinfo['quota'] + 20 ;
																mysql_query("update xige_info set quota='$quota',spread='$spread' where email='$cookieuser' ");
																mysql_query("UPDATE xige_user SET tip='1' WHERE email='$cookieuser'");
																echo "开通成功";
															}else{
																echo "您已开通";
															}
														}else{
															echo "推广不足";
														}
													}else{
														echo '<a href="?type=uptip">提升级别</a></td>';
													}
												}else{
													echo '<a href="?type=uptip">提升级别</a></td>';
												}
											
											
											?>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="footer">
<?php
require "../template/footer.php";
?>